using AdvancedInspector;
using Rilisoft;

[AdvancedInspector(true)]
public class TimingProduct
{
	public string idProd;

	private SaltedInt _timerSec = new SaltedInt(15151488);

	public int _time;

	public int TimerSec
	{
		get
		{
			return _timerSec.Value;
		}
		set
		{
			_timerSec.Value = value;
			_time = value;
		}
	}

	private string KeyForSave
	{
		get
		{
			return "Timer_" + idProd;
		}
	}

	public TimingProduct()
	{
		idProd = "Jopa";
		TimerSec = 100;
	}

	public TimingProduct(string id)
	{
		idProd = id;
		TimerSec = 0;
	}

	public TimingProduct(string id, int sec)
	{
		idProd = id;
		TimerSec = sec;
	}

	public void SaveTimer()
	{
		BCWStorage.Set(KeyForSave, TimerSec);
	}

	public void LoadTimer()
	{
		TimerSec = BCWStorage.Get<int>(KeyForSave);
	}
}
